package cn.com.dcsgo.dto;

import cn.com.dcsgo.validation.NotBlankIfNotNull;
import cn.com.dcsgo.validation.ValueOf;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * 添加商品SKU请求参数
 *
 * @author Dcsgo
 * @since 2025/10/21 11:02
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "添加商品SKU请求参数")
public class SkuAddDTO {
    /**
     * 商品规格信息，例如：内存:64G;颜色:红
     */
    @Schema(description = "商品规格信息，例如：内存:64G;颜色:红")
    private String properties;

    /**
     * 原价
     */
    @Min(value = 0, message = "原价不能小于0")
    @Schema(description = "原价")
    private BigDecimal oriPrice;

    /**
     * 价格
     */
    @Min(value = 0, message = "价格不能小于0")
    @Schema(description = "价格")
    private BigDecimal price;

    /**
     * 库存
     */
    @Min(value = 0, message = "库存不能小于0")
    @Schema(description = "库存")
    private Integer stocks;

    /**
     * sku图片
     */
    @Schema(description = "sku图片")
    private String pic;

    /**
     * sku名称
     */
    @NotBlankIfNotNull(message = "SKU名称不能为空或空白字符串")
    @Schema(description = "sku名称")
    private String skuName;

    /**
     * 商品名称
     */
    @NotBlankIfNotNull(message = "商品名称不能为空白字符串")
    @Schema(description = "商品名称")
    private String prodName;

    /**
     * 商品重量
     */
    @Schema(description = "商品重量")
    private Double weight;

    /**
     * 商品体积
     */
    @Schema(description = "商品体积")
    private Double volume;

    /**
     * 0 禁用 1 启用
     */
    @ValueOf(value = {"0", "1"}, message = "SKU状态只能为：0禁用，1启用")
    @Schema(description = "0 禁用 1 启用")
    private Integer status;
}
